This project was made using Node.js and Express and consists on an API used for a social network back-end workprocess.
- Sign-up and sign-in with jwt authentication
- User search
- Publishing posts
- Listing posts with pagination
- Listing 10 most popular hashtahgs
- Users' posts
- Hashtags' posts
- Post edition and deletion
- Interactions with post (likes, comments and re-posts)
You can check project's simplified documentation here.
Clone the project in your server with the following command:
-
Create a
.env
file in the root of the project. Populate it based on the.env.example
file. Keep all the values already set in the.env.example
and provide only the following:POSTGRES_USERNAME
POSTGRES_PASSWORD
POSTGRES_DATABASE
TOKEN_SECRET
DATABASE_URL
-
The
DATABASE_URL
must be completed considering the pattern below:postgresql://<POSTGRES_USERNAME>:<POSTGRES_PASSWORD>@<POSTGRES_HOST>:<POSTGRES_PORT>/<POSTGRES_DATABASE>?schema=public
-
Create a self-signed certificate by running the following command at the
src/config/
level:openssl req -nodes -new -x509 -keyout server.key -out server.cert
After running this command, you would get some options to fill. You can keep those options default or empty by entering ‘.‘ (dot).
Make sure that both
server.key
andserver.cert
are created and inside the config folder. -
Finally, at the root level of the project, run
docker compose up
to spin up the linkr server. -
(Optional) Run
docker compose down -v
to stop the linkr server.