- Install Node.JS LTS version
- Install neo4j
- Clone this repository and navigate to the cloned directory.
- Install dependencies by running:
yarn
ornpm install
- First, check which users exist in your database. When freshly created, only the 'neo4j' user will appear. Use the command
SHOW USERS
to view.
SHOW USERS
- The following command will create an 'admin' user with the password 'EXAMPLE@PASSWORD'.
CREATE USER example_admin IF NOT EXISTS
SET PLAINTEXT PASSWORD 'EXAMPLE@PASSWROD'
SET PASSWORD CHANGE REQUIRED
SET STATUS ACTIVE
SET HOME DATABASE neo4j
For more user creation options, refer to create-users
- The following command will grant the 'admin' role to the 'example_admin' user.
GRANT ROLE admin, PUBLIC TO example_admin
For more information, visit: neo4j managing users
$ cp .env.example .env
Example .env file:
PORT=8000
URL_DATABASE= neo4j://localhost:7687
USERNAME_DATABASE= admin
PASSWORD_DATABASE= example123
DATABASE_NAME= neo4j
- Run the command
yarn start
in the terminal to start the server.
$michel `yarn start`
- To run the tests, use the command
yarn test
:
$michel `yarn test`
- To test the API:
To test the API, you can use tools like Postman or Insomnia to create requests and view the API's responses.
Example:
If you use VSCode, it's a good choice to download the ESLint and Prettier extensions.
The database documentation is available at: Neo4j Documentation - FeiraOnline
Refer to the document Deploy for deployment instructions.