Coder Social home page Coder Social logo

rowinruizendaal / bloom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cmda-minor-web/meesterproef-2021

0.0 0.0 1.0 73.53 MB

Bloom is an application to connect people with each other who have had or still have cancer, these people can tell share their thought and opinions with others.

Home Page: https://bloom-hva.herokuapp.com/

License: MIT License

JavaScript 24.60% HTML 0.36% Vue 46.10% SCSS 28.91% Shell 0.02%
axios chat database express mongoosejs node sockets vue vuex

bloom's Introduction

Hi there ๐Ÿ‘‹

https://github.com/RowinRuizendaal/github-readme-stats https://github.com/RowinRuizendaal/github-readme-stats

Tech and Tools

Current favourites

Svelte Vue.js Nuxt.js Node.js

Other tools I use

React Html5 CSS3 Javascript Figma Sass MongoDB Express Python

"The best error message is the one that never shows up."

Racoon

trophy

bloom's People

Watchers

 avatar

Forkers

ralfz123

bloom's Issues

Standalone routes

Bloom/server/server.js

Lines 36 to 39 in 0923374

app.post("/api/login", handleLogin);
// Register
app.post("/api/register", handleRegister);

Maybe you can take a look at MVC pattern;

You have your index/app.js as root
You will create a router folder - which includes all your routing logic, from the routing folder you call your controllers which contain logic with respect to handling events etc.

Try a more modular approach here

Bloom/server/server.js

Lines 16 to 27 in 0923374

db.mongoose
.connect(db.url, {
useNewUrlParser: true,
useUnifiedTopology: true,
})
.then(() => {
console.log("Connected to the database!");
})
.catch((err) => {
console.log("Cannot connect to the database!", err);
process.exit();
});

Maybe it's an idea to create a config folder where you can write your db logic - then export the connect function and simply call that function inside your index.js / app.js. This way you keep your root file clean.

Dynamic backbutton

App remembers what user's latest page is he/she has visited. So can the back button (arrow) linked to that page.

Silka Font

Silka font in the h2 in the header is too thin. There must be a bolder font.

PWA

Change PWA icon, and make gif to show what PWA is all about. Install-> open

Register: Email & pw steps

Email and password were not available in the register proces, but they are required to login with your account. So I add these 2 inputs in the register process.

Adding additional logic to schema

const userSchema = new Schema({
firstName: String,
surName: String,
emailAddress: String,
password: String,
birthDate: String,
town: String,
gender: String,
typeIllness: String,
profileAvatar: String,
about: String,
});

You can write more in depth requirements for your schema, e.g:

email: {     
  type: String,      
  required: [true, 'E-mail is verplicht'],      
  unique: true,      
  trim: true,      
  minlength: 1,      
  maxlength: [50, 'E-mail mag niet meer karakters dan 50 bevatten']    
}

Buddies

You can currently see yourself on the buddies list

Styling UI

Check if the styling of the whole application is equal to the design

Bug: chats overview

When clicking on a chat and you go back to the overview, the overview is empty.

move to a socket module?

Bloom/server/server.js

Lines 20 to 50 in 0c2ec36

// Sockets
io.on('connection', (socket) => {
socket.emit('connections', Object.keys(io.sockets.connected).length);
socket.on('disconnect', () => {
console.log("A user disconnected");
});
socket.on('chat-message', (data) => {
socket.broadcast.emit('chat-message', (data));
});
socket.on('typing', (data) => {
socket.broadcast.emit('typing', (data));
});
socket.on('stopTyping', () => {
socket.broadcast.emit('stopTyping');
});
socket.on('joined', (data) => {
socket.broadcast.emit('joined', (data));
});
socket.on('leave', (data) => {
socket.broadcast.emit('leave', (data));
});
});

And thus keeping the app.s file cleaner...

Slugs for themes

Making the slugs for theme's so we are preventing making 20 pages.

Index page

Making the index page (first screen), also setting up variables & project structure

Making more components

  • Bottom nav

props:

  props: {
    active: {
      type: String,
      default: "home",
    },

We can use different props to make the active icon in the navbar highlighted these are:

home
buddies
messages
profile

image

refactor folder structure

Bloom/server/server.js

Lines 29 to 33 in 0923374

// Get all users of db
async function getAllUsers() {
const users = await Users.find().catch((err) => console.log(err));
console.log(users);
}

Ideally you want to have stand alone folders/files for this kind of logic. Create a helper function which gets the users. This way you can import the helper function in more files - without having to write duplicate code.

/users

/users returns full json

UI Stack

Login

  • When an account doesn't exist
  • When password/email isn't correct
  • styling

Buddy details vue parse error

[Vue warn]: Error in render: "TypeError: Cannot read property 'profileAvatar' of undefined"

found in

---> <BuddyDetail> at src/views/buddies/buddyDetail.vue
       <App> at src/App.vue
         <Root>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.