https://github.com/imranr98/andika
Note-taking Web App
https://github.com/imranr98/andika
Last synced: 8 months ago
JSON representation
Note-taking Web App
- Host: GitHub
- URL: https://github.com/imranr98/andika
- Owner: ImranR98
- License: apache-2.0
- Archived: true
- Created: 2019-05-13T20:25:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-14T03:51:14.000Z (almost 3 years ago)
- Last Synced: 2025-05-12T02:55:01.153Z (8 months ago)
- Language: TypeScript
- Homepage:
- Size: 5.58 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Andika
Simple Note taking Application made with Angular, Node.js and PostgreSQL.
## Screenshots


## Getting Started
Install Angular and Node.js, and set up a PostgreSQL database.
### Prerequisites
A .env file, described below, is needed at the root directory that will contain environment variables. This file contains sensitive data and should not be removed from .gitignore.
```
DATABASE_URL - The URL of the Postgres database.
NODEMAILER_EMAIL - The email address emails from the App will be sent from using nodemailer
NODEMAILER_NAME - The name of the sender for above emails
NODEMAILER_TRANSPORT_JSON - The stringified JSON object used to create the NodeMailer transporter, usually something like {"host":"smtp.example.com","port":587,"secure":true,"auth":{"user":"username","pass":"password"}}
EXPIRES_IN - The number of seconds a client session lasts
RSA_PRIVATE_KEY - The private RSA key used to protect client sessions
RSA_PUBLIC_KEY - The public key corresponding to the above private key
```
The Database will need specific tables. SQL Commands to create them are listed below:
```
CREATE TABLE USERS (
USER_ID INT GENERATED BY DEFAULT AS IDENTITY,
EMAIL VARCHAR(100) NOT NULL UNIQUE,
FIRST_NAME VARCHAR(100) NOT NULL,
LAST_NAME VARCHAR(100) NOT NULL,
PASSWORD VARCHAR(200) NOT NULL,
REGISTRATION_STATUS VARCHAR(10) NOT NULL,
REGISTRATION_KEY VARCHAR(100) NOT NULL,
REGISTRATION_START_DATE TIMESTAMP NOT NULL,
REGISTRATION_COMPLETE_DATE TIMESTAMP,
USER_TYPE VARCHAR(100) NOT NULL,
PRIMARY KEY(USER_ID)
);
CREATE TABLE NOTES (
NOTE_ID INT GENERATED BY DEFAULT AS IDENTITY,
USER_ID INT NOT NULL,
TITLE VARCHAR(100) NOT NULL,
NOTE VARCHAR(10485760),
TAGS VARCHAR(10485760),
ARCHIVED BOOLEAN NOT NULL,
PINNED BOOLEAN NOT NULL,
CREATED_DATE TIMESTAMP NOT NULL,
MODIFIED_DATE TIMESTAMP NOT NULL,
IMAGE_TYPE VARCHAR(100),
IMAGE_BASE_64 VARCHAR(10485760),
FOREIGN KEY (USER_ID) REFERENCES USERS(USER_ID)
);
CREATE TABLE PASSWORD_RESETS (
USER_ID INT,
NEW_PASSWORD VARCHAR(200) NOT NULL,
RESET_KEY VARCHAR(100) NOT NULL,
PRIMARY KEY (USER_ID),
FOREIGN KEY (USER_ID) REFERENCES USERS(USER_ID)
);
```
Note:
- Valid user types are REGULAR and ADMIN, and users must be changed to ADMIN manually (no in-app way to do so)
- Valid registration statuses are PENDING and COMPLETE
## Deployment
- Configure a PostgreSQL database with the tables defined above.
- Copy the DB connection string into a .env file.
- Fill in the remaining variables in the .env file as described above.
- Run `npm start` to start the application (runs on port 8080 by default).