This project is a simple contact list built from scratch.
- Backend:
- Typescript
- Node.js
- MySQL
- Prisma ORM
- Tests: Mocha, Chai, Sinon
- Frontend
- Typescript
- React
- Tests: Jest, React Testing Library
-
Clone the repository
git clone git@github.com:braien-machado/contact-list.git
-
Go to the cloned repository
cd contact-list
-
Install the dependencies
npm install
-
Build the mySQL database with docker-compose
npm run compose:up
- Obs: If you get a timeout error in the first time running compose:up, remove the container and run the command again.
-
Create a .env file with a DATABASE_URL value as in .env.example if using db from my docker-compose or edit the value to use another mysql database
-
Go to backend directory and start the api
cd app/backend && npm start
- Obs: If you get a server error, check the db container status. While its status is not
Healthy
wait a little longer. WhenHealthy
, runnpm start
again
-
Open another terminal, go to frontend directory and start the app
cd app/frontend && npm start
-
If the app do not open automatically, search for http://localhost:3000/ in any browser
- Go to backend directory
cd app/backend
- Run the tests
npm run test:coverage
- Go to frontend directory
cd app/frontend
- Run the tests
npm run test:coverage
To improve the project, I think I could work on the following subjects:
- Create an user table
- Create a login route so user can have access just to their contacts
- Improve patch routes in order to allow user to update multiple tables at once
- Improve post routes in order to allow user to create contact, phone numbers and emails at once
- Improve test coverage
- Create register and login pages
- Improve style
- Display notifications about request errors
- Allow user to update and create all contact info at once
- Improve test coverage
- Make docker-compose create the backend and frontend together with the database
- Deploy