User registration application capable of creating, reading, updating and deleting database users (CRUD). The project is divided into Front-end and Back-end, both environments (and the database) run inside a container created by Docker Compose ๐ณ.
๐งฐ Powered by
- Next.js
- Sass/Scss
- TypeScript
- Node.js
- Express
- Prism
- PostgreSQL
- Docker
๐ง Installation
โ ๏ธ You must have Docker and Docker Compose installed on your machine to run this project in containers.
- Clone this repository:
git clone [email protected]:adilsongb/registrado-app.git
- Access the project folder:
app-registered cd
- Upload application containers using Docker Compose command:
๐ The process of installing the dependencies is done during the construction of the container for each environment.
docker-compose up
โ ๏ธ The development environment is created using thedocker-compose.yml
file! With it, the Back and Front containers are updated with each change made to the project files.
- All very well! You can access the application at the following addresses:
- Frontend:
http://localhost:3000/
- Backend:
http://localhost:3001/
- Frontend:
๐ป Deploy
- The deployment is performed on the Heroku platform. Application links:
- The deployment of both environments (Front and Back-end) is performed automatically through GitHub Actions. Any change made to the
main
branch of the project's remote repository starts the deployment process. - The deploy action file can be found at:
.github/workflows/main.yml
.
๐ก Hint
- In the project there is a file
app.code-workspace
, with it a workspace is created in VSCode separating the Front-end and the Back-end of the application.
- The application's back-end was developed with
Node.js
,TypeScript
,Express
andPrisma
. The application can be accessed locally (if the container is running) athttp://localhost:3001/
.
๐ Organization
โโโ ๐ registered-app
โโโ ๐ backend
| โโโ ๐ prism
| | โโโ ๐ migrations // Prisma schema migration history
| | โโโ ๐ seed.ts // File with initial DB data
| | โโโ ๐ schema.prisma // File that references and configures DB tables
| โโโ ๐ src
โ โโโ ๐ database
โ | โโโ ๐ connection.ts // Connect to the database through Prisma Client
| โโโ ๐ models // Folder with files that communicate directly with DB
| โโโ ๐ services // Folder with files that connect the client and DB
| โโโ ๐ controllers // Folder with files that communicate directly with the client
| โโโ ๐ interfaces // Folder with object typing interfaces
| โโโ ๐ validations // Folder with the validations performed by the Joi library
| โโโ ๐ middleware
| | โโโ ๐ error.ts // Middleware for API error handling
| โโโ ๐ routes // Folder with API routes (Endpoints)
| โโโ ๐ server.ts // API configuration and initialization file
โโโ ๐ frontend
๐ฏ Endpoints
GET
-
-
Returns an array containing 10 users. Depending on the number passed in the
:page
parameter only a specific fraction of users is returned, for example: The/users/page/2
endpoint returns users of order 11-20. (Endpoint created especially to give the pagination effect on the Front-end)๐ช Return example
[ { "id": 1, "name": "Adilson Gabriel", "email": "[email protected]", "password": "F4MAJVQ3hkFElTb", "createdAt": "2022-05-26T21:42:34.364Z" }, { "id": 2, "name": "Carlos Nogueira", "email": "[email protected]", "password": "GsI2Y00ca05Lftu", "createdAt": "2022-05-26T21:42:34.364Z" },
-