To implement a small open source social network for any small community.
This is the simplest way to run the project. Only Docker is needed as a dependency.
Pull and run a complete image from Docker Hub.
docker pull mecatronicauncu/red-social-asociacion-dev
docker run -p 3000:3000 -t -i mecatronicauncu/red-social-asociacion-dev
You can access to the website using your preferred browser
https://localhost:3000/
Alternatively, build your own Docker image using the Dockerfile provided in this repository.
curl https://raw.githubusercontent.com/mecatronicauncu/Red-Social-Asociacion/develop/Dockerfile > Dockerfile
docker build -t red-social-asociacion-dev .
docker run -p 3000:3000 -t -i red-social-asociacion-dev
This method is a little bit more complicated and requires the following dependencies.
If you don't have nodejs installed, use Node Version Manager
(nvm). In the same way,
install Ruby using Ruby Version Manager (rvm).
Please be sure to source the appropriate files in your .bashrc
or .zshrc
.
Clone the repository and execute the install script.
git clone https://github.com/MecatronicaUncu/Red-Social-Asociacion.git
cd Red-Social-Asociacion
./script/bootstrap
Afterwards, configure the server.
./script/config
Note: config
script accepts the following parameters:
NET
host is selected.Start the database server neo4j
./script/Neo4j/neoStart
Run the server
grunt build
grunt express
The Social Network will be available at port 3000: HOST:3000
The installation using Docker should work out of the box. Please refer to Install and Run in Linux.
Note: It is a good idea to have a quick look to the Docker User Guide to understand how Docker works.
Run a shell in a container using the following command
docker run -p 3000:3000 -t -i mecatronicauncu/red-social-asociacion-dev /bin/bash
Then, run the server using the commands from the section
Running the server.
grunt watch
may be used instead of grunt express
to trigger
automatic builds when files are modified.
Multiple shells may be executed in the same container.
docker exec -i -t CONTAINER_ID /bin/bash
Docker dev images have sudo
access enabled. Hence, you are able to install
your favorite software for development.
If you want to interact with Github (push/fetch/pull
), change the
repository remote address (to use SSH instead of HTTP), and set up your
SSH keys.
Copy your SSH keys from the Docker Host to a running container with the following command
docker cp /path/to/.ssh CONTAINER_ID:/red-social-asoc/.ssh
Remember to fix .ssh
folder permissions inside the running container
(inside container)$ sudo chown -R swuser:swuser ~/.ssh/
The GitHub Tutorial for SSH keys is a good resource for SSH keys.
We follow the approach of ngbp.
Most important:
|-- server
|-- server.js Server (expressjs) configuration
|-- routes
|-- moduleName.js High level API calls
|-- _moduleName.js Database access functions for module
|-- upload Uploaded files (such as profile images) *
|-- bin Binary files (neo4j).
Available after running ```./setup.sh```.
|-- src Front-end stuff
|-- app State templates, sass and javascript (views)
|-- app.js Angular app main module
|-- assets Static content. Fonts, Styles, etc
|-- common Directives
|-- sass Sass main file and co.
You may register fictitious users in the database, for test purposes.
For instance, script/Datasets/userBase/userBase
will register 50 users
in your database and add some relationships. After running it, you can
check the user list with their login info inside
people_email_pass.csv
.
To clean your database, execute the following query in the Neo4J browser: MATCH (u)-[r]-() DELETE r,u
.
Note: The list of users IDs (saved in usersIDs.csv
) is not deterministic. Running the script twice will result in relationships not intended to be created. This will not have adverse effects, but it must be taken into consideration.
Note: userBase
accepts one parameter: no-wait
. This will assume your Neo4J server is running and continue the process without asking.
Do not hesitate to submit your issue or pull request!